package com.bootdo.hotel.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.bootdo.hotel.dao.HotelRoomTypeDao;
import com.bootdo.hotel.domain.HotelRoomType;
import com.bootdo.hotel.service.HotelRoomTypeService;



@Service
public class HotelRoomTypeServiceImpl implements HotelRoomTypeService {
	@Autowired
	private HotelRoomTypeDao hotelRoomTypeDao;
	
	@Override
	public HotelRoomType get(Long id){
		return hotelRoomTypeDao.get(id);
	}
	
	@Override
	public List<HotelRoomType> list(Map<String, Object> map){
		return hotelRoomTypeDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return hotelRoomTypeDao.count(map);
	}
	
	@Override
	public int save(HotelRoomType hotelRoomType){
	
		if(hotelRoomType.getId() != null) {
			return hotelRoomTypeDao.update(hotelRoomType);
		}else {
			return hotelRoomTypeDao.save(hotelRoomType);
		}		
	
		
	}
	
	@Override
	public int update(HotelRoomType hotelRoomType){
		return hotelRoomTypeDao.update(hotelRoomType);
	}
	
	@Override
	public int remove(Long id){
		return hotelRoomTypeDao.remove(id);
	}
	
	@Override
	public int batchRemove(Long[] ids){
		return hotelRoomTypeDao.batchRemove(ids);
	}
	
}
